import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { NgxsModule } from '@ngxs/store';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
// 组件
import { AppComponent } from './app.component';
import {IndexComponent} from './index/index.component'; // 首页
import {NavComponent} from './nav/nav.component'; // 导航条
import {BarComponent} from './bar/bar.component'; // 底部导航条
import {RosterComponent} from './roster/roster.component'; // 花名册首页
import {JoinRosterComponent} from './join-roster/join-roster.component'; //加入花名册
import {RosterInfoComponent} from './roster-info/roster-info.component';//班级详情页面
// 服务
import {UtilService} from './my-service/util.service'; // 工具服务
import {RollService} from './my-service/roll.service'; // 花名册服务
import {CodeService} from './my-service/code.service'; // 邀请码服务
// 状态管理
import {UserGuidState, UserState,NavState,RosterState,BackgroundState,BackgroundVariedState} from './app.state';
//管道
import {ToHTMLPipe} from './my-pipe/to-html.pipe';

@NgModule({
  declarations: [
    AppComponent,
    IndexComponent,
    NavComponent,
    BarComponent,
    RosterComponent,
    JoinRosterComponent,
    RosterInfoComponent,
    ToHTMLPipe
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    HttpClientModule,
    FormsModule,
    NgxsModule.forRoot([
      UserState,
      UserGuidState,
      NavState,
      RosterState,
      BackgroundState,
      BackgroundVariedState
    ])
  ],
  providers: [
    UtilService,
    RollService,
    CodeService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
